<template>
  <div>
    <!--查询条件start --111s-->
    <el-card>
      <el-form :inline="true" :model="query" class="query-form" size="small">
        <!-- <el-form-item
          class="query-form-item"
          label="商品名称："
        >
          <el-input
            v-model="query.commodityName"
            placeholder="商品名称"
            prefix-icon="el-icon-search"
            @keyup.enter.native="onSubmit"
            clearable
            style="width: 200px"
            maxlength="20"
          ></el-input>
        </el-form-item><br /> -->
        <!-- <el-form-item class="query-form-item" label="收货地址查询订单："></el-form-item>
            <el-form-item label="省:" prop="provinceId">
                <el-select v-model="query.provinceId" placeholder="选择订单所在省" @change="provinceChange()" style="width: 150px;" >
                    <el-option v-for="(item,index) in this.formData.provinceList"
                               :key="index"
                               :label="item.areaname"
                               :value="item.areaid">
                    </el-option>
                </el-select>
            </el-form-item>
            <el-form-item label="市:" prop="cityId">
                <el-select v-model="query.cityId" placeholder="选择订单所在市" @change="cityChange()"  style="width: 150px;"  >
                    <el-option v-for="(item,index) in this.formData.cityList"
                               :key="index"
                               :label="item.areaname"
                               :value="item.areaid">
                    </el-option>
                </el-select>
            </el-form-item>
            <el-form-item label="县/区"  prop="areaId">
                <el-select v-model="query.areaId" placeholder="选择订单所在县" @change="areaChange()" style="width: 150px;" >
                    <el-option v-for="(item,index) in this.formData.areaList"
                               :key="index"
                               :label="item.areaname"
                               :value="item.areaid">
                    </el-option>
                </el-select>
            </el-form-item>
            <el-form-item class="query-form-item">
                <el-input
                    v-model="query.userAddress"
                    placeholder="收货地址"
                    prefix-icon="el-icon-search"
                    @keyup.enter.native="onSubmit"
                    clearable
                    style="width: 200px;"

                ></el-input>
            </el-form-item><br/> -->
        <el-form-item label="订单状态：">
          <el-select
            v-model="query.onshelfstatus"
            placeholder="请选择订单状态"
            @change="shelfstatus"
            clearable
            style="width: 150px"
          >
            <el-option label="待付款" value="0"> </el-option>
            <el-option label="待发货" value="1"> </el-option>
            <el-option label="待收货" value="2"> </el-option>
            <el-option label="已完成" value="3"> </el-option>
            <el-option label="已关闭" value="4"> </el-option>
            <el-option label="已取消" value="5"> </el-option>
          </el-select>
        </el-form-item>

        <el-form-item class="query-form-item">
          <el-input
            v-model="query.content"
            placeholder="订单号/买家/买家联系方式"
            prefix-icon="el-icon-search"
            @keyup.enter.native="onSubmit"
            clearable
            style="width: 240px"
          ></el-input>
        </el-form-item>
      </el-form>

      <!--el-form-item style="margin-left: 550px; display: none">
                <el-button type="primary" @click="handleForm"  >
                    自动收货:{{shouhuodata.receivingdoodsdays}}天
                </el-button>
            </el-form-item-->
      <!--时间段-->

      <el-form :inline="true" :model="query" class="query-form" size="small">
        <el-form-item label="时间查询：">
          <el-date-picker
            v-model="createTime"
            unlink-panels
            type="datetimerange"
            :picker-options="pickerOptions"
            range-separator="-"
            start-placeholder="开始日期"
            end-placeholder="结束日期"
            align="left"
            format="yyyy-MM-dd HH:mm:ss"
            value-format="yyyy-MM-dd HH:mm:ss"
            :default-time="['00:00:00', '23:59:59']"
            @change="dateChange"
            style="margin-left: 3px"
          ></el-date-picker>
        </el-form-item>
        <el-button
          type="primary"
          :plain="today"
          @click="todayclick()"
          style="height: 31.99px; padding: 10px 20px"
          >今天</el-button
        >
        <el-button
          type="primary"
          :plain="yestoday"
          @click="yestodayclick()"
          style="height: 31.99px; padding: 10px 20px"
          >昨天</el-button
        >
        <el-button
          type="primary"
          :plain="week"
          @click="weekclick()"
          style="height: 31.99px; padding: 10px 20px"
          >一周内</el-button
        >
        <el-button
          type="primary"
          :plain="month"
          @click="monthclick()"
          style="height: 31.99px; padding: 10px 20px; margin-right: 10px"
          >一月内</el-button
        >

        <el-form-item>
          <el-button
            type="primary"
            icon="el-icon-refresh"
            @click="onRest"
          ></el-button>
          <el-button
            type="primary"
            icon="el-icon-search"
            @click="onSubmit"
            style="height: 31.1px"
            >查询</el-button
          >
        </el-form-item>
      </el-form>
      <!--列表start --222s-->
      <el-table
        :data="list"
        :header-cell-style="{ background: '#F4F4F5', color: '#606266' }"
        style="width: 100%"
      >
        <el-table-column type="expand">
          <template slot-scope="scope">
            <el-form
              style="margin-left: 100px"
              inline
              class="demo-table-expand"
            >
              <el-table
                :data="scope.row.secondordersPC"
                style="width: 90%"
                :header-cell-style="{ background: '#F4F4F5', color: '#606266' }"
                :row-class-name="tableRowClassName"
              >
                <el-table-column
                  label="商品名称"
                  prop="commodityname"
                  align="center"
                >
                </el-table-column>
                 <el-table-column label="商品规格" prop="inventory" width="100">
                              <template slot-scope="scope">
                                    <span
                      > {{
                        scope.row.inventory
                          .toString()
                          .replace(/\"/g, "")
                          .replace(/\{|}/g, "")
                      }}</span
                    >
                               </template
                  >         
                </el-table-column>
                <el-table-column
                  label="购买数量"
                  prop="purchasenum"
                  align="center"
                >
                </el-table-column>
              </el-table>
            </el-form>
          </template>
        </el-table-column>

        <el-table-column
          label="ID/订单号"
          prop="ordernumber"
          align="center"
          width="300"
        >
          <template slot-scope="scope">
            <el-button @click="todetail(scope.row)">
              {{ scope.row.ordernumber }}</el-button
            >
          </template>
        </el-table-column>
        <el-table-column label="客户信息" align="left">
          <template slot-scope="scope">
            【姓名】{{ scope.row.useraddressname }}
            <br />
            【手机号】{{ scope.row.useraddressphone }}
            <br />
            【地址】{{ scope.row.provinceName }}
            {{ scope.row.cityName }}
            {{ scope.row.areaName }}
            {{ scope.row.useraddress }}
          </template>
        </el-table-column>
        <el-table-column label="数量/价格（元）" prop="orderrealprice">
        </el-table-column>

        <el-table-column label="支付方式">
          <template slot-scope="scope"> 余额支付 </template>
        </el-table-column>
        <el-table-column label="订单状态">
          <template slot-scope="scope">
            {{ scope.row.orderstatus }}
          </template>
        </el-table-column>

        <!--            <el-table-column
                label="运费"
                prop="postage">
            </el-table-column>
            <el-table-column
                label="获取积分"
                prop="createintegral">
            </el-table-column>-->
        <el-table-column
          label="创建时间"
          with="300"
          :show-overflow-tooltip="true"
        >
          <template slot-scope="scope">
            <i class="el-icon-time" v-if="scope.row.createtime != null"></i>
            <span v-if="scope.row.createtime != null">
              {{ scope.row.createtime | formatDateStr("yyyy-MM-dd hh:mm:ss") }}
            </span>
          </template>
        </el-table-column>
      </el-table>
      <!--分页模块start-->
      <el-pagination
        class="pagination-container"
        background
        :page-size="query.pageSize"
        @size-change="handleSizeChange"
        @current-change="handleCurrentChange"
        layout="total,sizes,prev, pager, next, jumper"
        :current-page="query.currentPage"
        :page-sizes="[5, 10, 20, 30, 50]"
        :total="totalNumber"
      ></el-pagination>
      <!--分页模块end-->

      <!--收货-->
      <el-dialog
        :title="formMap[formName]"
        :visible.sync="formVisible"
        :before-close="hideForm"
        width="450px"
        top="20vh"
        v-dialogDrag
        :close-on-click-modal="false"
      >
        <template slot="title">
          <div class="avue-crud__dialog__header">
            <span class="el-dialog__title">
              <span
                style="
                  display: inline-block;
                  background-color: #3478f5;
                  width: 3px;
                  height: 20px;
                  margin-right: 5px;
                  float: left;
                  margin-top: 2px;
                "
              ></span>
              {{ formMap[formName] }}
            </span>
          </div>
        </template>
        <el-card>
          <el-form v-model="shouhuo.receivingdoodsdays">
            <el-form-item label="收货时间:">
              <el-input
                style="width: 200px"
                v-model="shouhuo.receivingdoodsdays"
              >
              </el-input>
              天
            </el-form-item>
          </el-form>
          如果用户规定时间内没有确认收货，且未提交任何售后信息，则系统自动确认收货
        </el-card>
        <div slot="footer" class="dialog-footer">
          <el-button @click.native="hideForm">取消</el-button>
          <el-button
            type="primary"
            @click.native="updateReceiving()"
            :loading="formLoading"
            >提交</el-button
          >
        </div>
      </el-dialog>
    </el-card>
  </div>
</template>
<script>
import {
  getList,
  getReceivingGgoods,
  updateReceivingGgoods,
} from "../../api/buscommodity/purchaseOrder";
import { getProvinceOrCityOrAreaList } from "../../api/common/common";
/*用作表单的数据初始化*/
const formJson = {
  orderid: 1,
  userid: 1,
  ordernumber: "", //订单号
  orderstatus: "",
  useraddressname: "",
  useraddressphone: "",
  provinceid: "",
  cityid: "",
  areaid: "",
  useraddress: "",
  orderpayprice: "",
  purchasetype: "",
  paymenttype: "",
  outtradeno: "",
  usercouponid: "",
  paytime: "",
  orderrealprice: "",
  postage: "",
  integralnum: "",
  orderrefundprice: "",
  createtime: "",
  exchangevalue: "",
  moneyvalue: "",
  orderisdel: "",
  secondordersPC: [],
  provinceList: [],
  cityList: [],
  areaList: [],
};
const formreceiving = {
  id: "",
  receivingdoodsdays: "",
};

export default {
  name: "order",
  data() {
    return {
      formData: formJson,
      pickerOptions: {
        //快速选择日期
        shortcuts: [
          {
            text: "最近一周",
            onClick(picker) {
              const end = new Date();
              const start = new Date();
              start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
              picker.$emit("pick", [start, end]);
            },
          },
          {
            text: "最近一个月",
            onClick(picker) {
              const end = new Date();
              const start = new Date();
              start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
              picker.$emit("pick", [start, end]);
            },
          },
          {
            text: "最近三个月",
            onClick(picker) {
              const end = new Date();
              const start = new Date();
              start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
              picker.$emit("pick", [start, end]);
            },
          },
          {
            text: "最近六个月",
            onClick(picker) {
              const end = new Date();
              const start = new Date();
              start.setTime(start.getTime() - 3600 * 1000 * 24 * 180);
              picker.$emit("pick", [start, end]);
            },
          },
        ],
      },
      today: true,
      yestoday: true,
      week: true,
      month: true,
      query: {
        //查询条件
        content: "",
        userid: "", //用户id
        onshelfstatus: "",
        currentPage: 1,
        pageSize: 5,
        starttime: "",
        endtime: "",
        provinceId: "",
        cityId: "",
        areaId: "",
        commodityName: "",
        userAddress: "",
      },
      createTime: [], //选择日期时需要的model
      list: [], //列表集合
      totalNumber: 0, //分页总页数
      // formVisible: false,//添加编辑显示
      loading: true, //列表加载
      formLoading: false, //表单提交加载
      allLoding: false, //全屏加载
      cancelToggle: false,
      detailVisible: false, //查看
      //multipleSelection: [], //多选集
      shouhuodata: {},
      shouhuo: formreceiving, //收货商城
      formName: "",
      formMap: {
        add: "", //自动收货期限
      },
      formVisible: false, //收货
      formRules: {
        provinceId: {
          required: true,
          message: "请选择订单所在省",
          trigger: "blur",
        },
        cityId: [
          {
            required: true,
            message: "请选择订单所在市",
            trigger: "blur",
          },
        ],
        areaId: [
          {
            required: true,
            message: "请选择订单所在区/县",
            trigger: "blur",
          },
        ],
      },
    };
  },
  methods: {
    provinceBlur() {
      //console.log("name：" + this.user.username);
      //  alert(this.query.provinceId);
      if (this.query.provinceId != null && this.query.provinceId != "") {
        this.formRules.provinceId.required = false;
      }
      if (this.query.provinceId == null || this.query.provinceId == "") {
        this.formRules.provinceId.required = true;
        // this.showMassage("请选择订单所在省");
      }
    },
    getProvinceList() {
      let data = {
        parentAreaId: "",
      };
      var params = new URLSearchParams(data);
      this.loading = true;
      getProvinceOrCityOrAreaList(params)
        .then((response) => {
          if (response.code != 0) {
            this.$message.error(response.message);
            return false;
          }
          console.log(response);
          this.formData.provinceList = response.data || [];
          this.query.cityId = "";
          this.query.areaId = "";
          this.formData.cityList = [];
          this.formData.areaList = [];
          setTimeout(() => {
            this.loading = false;
          }, 0.3 * 1000);
        })
        .catch(() => {
          this.loading = false;
        });
    },
    provinceChange() {
      if (this.query.provinceId == "") {
        return false;
      }
      console.info(" parentAreaId=" + this.query.provinceId);
      let data = {
        parentAreaId: this.query.provinceId,
      };
      var params = new URLSearchParams(data);
      this.loading = true;
      getProvinceOrCityOrAreaList(params)
        .then((response) => {
          if (response.code != 0) {
            this.$message.error(response.message);
            return false;
          }
          console.log(response);
          this.formData.cityList = response.data || [];
          this.query.cityId = "";
          this.query.areaId = "";
          this.formData.areaList = [];
          setTimeout(() => {
            this.loading = false;
          }, 0.3 * 1000);
        })
        .catch(() => {
          this.loading = false;
        });
    },
    //二级
    cityChange() {
      if (this.query.cityId == "") {
        return false;
      }
      let data = {
        parentAreaId: this.query.cityId,
      };
      var params = new URLSearchParams(data);
      this.loading = true;
      getProvinceOrCityOrAreaList(params)
        .then((response) => {
          if (response.code != 0) {
            this.$message.error(response.message);
            return false;
          }
          console.log(response);
          this.formData.areaList = response.data || [];
          setTimeout(() => {
            this.loading = false;
          }, 0.3 * 1000);
        })
        .catch(() => {
          this.loading = false;
        });
    },
    //三级
    areaChange() {
      return false;
    },
    //订单详细
    todetail(row) {
      if (row !== null) {
        this.$router.push({
          path: "/merchantOrder/purchaseOrderDetail",
          query: { orderid: row.orderid },
        });
      }
    },

    fun_date(aa) {
      var date1 = new Date(),
        time1 =
          date1.getFullYear() +
          "-" +
          (date1.getMonth() + 1) +
          "-" +
          date1.getDate() +
          " " +
          date1.getHours() +
          ":" +
          date1.getMinutes() +
          ":" +
          date1.getSeconds(); //time1表示当前时间
      var date2 = new Date(date1);
      this.query.endtime = time1;
      date2.setDate(date1.getDate() - aa);
      var time2 =
        date2.getFullYear() +
        "-" +
        (date2.getMonth() + 1) +
        "-" +
        date2.getDate() +
        " " +
        date2.getHours() +
        ":" +
        date2.getMinutes() +
        ":" +
        date2.getSeconds();
      this.query.starttime = time2;
      // alert(this.query.starttime+this.query.endtime)
    },

    //今天
    todayclick() {
      var date1 = new Date(),
        time1 =
          date1.getFullYear() +
          "-" +
          (date1.getMonth() + 1) +
          "-" +
          date1.getDate() +
          " " +
          date1.getHours() +
          ":" +
          date1.getMinutes() +
          ":" +
          date1.getSeconds(); //time1表示当前时间
      var time2 =
        date1.getFullYear() +
        "-" +
        (date1.getMonth() + 1) +
        "-" +
        date1.getDate();
      this.query.starttime = time2 + " " + "00:00:00";
      this.query.endtime = time2 + " " + "23:59:59";
      this.query.currentPage = 1;
      (this.today = false),
        (this.yestoday = true),
        (this.week = true),
        (this.month = true),
        this.getList();
    },
    //昨天
    yestodayclick() {
      var date1 = new Date(),
        time1 =
          date1.getFullYear() +
          "-" +
          (date1.getMonth() + 1) +
          "-" +
          date1.getDate() +
          " " +
          date1.getHours() +
          ":" +
          date1.getMinutes() +
          ":" +
          date1.getSeconds(); //time1表示当前时间
      var date2 = new Date(date1);
      date2.setDate(date1.getDate() - 1);
      var time2 =
        date2.getFullYear() +
        "-" +
        (date2.getMonth() + 1) +
        "-" +
        date2.getDate() +
        " ";
      this.query.starttime = time2 + " " + "00:00:00";
      this.query.endtime = time2 + " " + "23:59:59";
      this.query.currentPage = 1;
      (this.today = true),
        (this.yestoday = false),
        (this.week = true),
        (this.month = true),
        this.getList();
    },
    //周内
    weekclick() {
      this.fun_date(7);
      this.query.currentPage = 1;
      (this.today = true),
        (this.yestoday = true),
        (this.week = false),
        (this.month = true),
        this.getList();
    },
    //月内
    monthclick() {
      this.fun_date(30);
      this.query.currentPage = 1;
      (this.today = true),
        (this.yestoday = true),
        (this.week = true),
        (this.month = false),
        this.getList();
    },
    updateReceiving() {
      this.loading = true;
      let paramters = new URLSearchParams(this.shouhuo);
      updateReceivingGgoods(paramters)
        .then((response) => {
          if (response.code) {
            this.$message.error(response.message);
            this.loading = false;
            return;
          }
          this.formVisible = false;
          this.loading = false;
          this.$message.success("提交成功");
          this.getReceiving();
        })
        .catch(() => {
          this.loading = false;
          this.formVisible == false;
        });
    },

    getReceiving() {
      this.loading = true;
      getReceivingGgoods()
        .then((response) => {
          if (response.code) {
            this.$message.error(response.message);
          }
          let data = response.data;
          console.info(data);
          this.shouhuodata = data;

          this.loading = false;
        })
        .catch(() => {
          this.loading = false;
        });
    },
    /*获取列表事件*/
    getList() {
      this.loading = true;
      this.list = [];
      getList(this.query)
        .then((response) => {
          this.loading = false;
          if (response.code != 0) {
            this.$message.error(response.message);
            return false;
          }
          let datalist = response.data.list || [];
          if (datalist.length > 0) {
            let mylist = datalist;
            for (var i = 0; i < mylist.length; i++) {
              if (mylist[i].orderstatus != null) {
                mylist[i].orderstatus = mylist[i].orderstatus.toString();
              }
              if (mylist[i].onshelfstatus != null) {
                mylist[i].onshelfstatus = mylist[i].orderstatus.toString();
              }
              if (mylist[i].secondordersPC != null) {
                let sec = mylist[i].secondordersPC;
                let num = null; //第二订单购买数据
                let totalOrderPrice = 0;
                for (var j = 0; j < sec.length; j++) {
                  let pur = sec[j].purchasenum;
                  num = num + pur;
                  totalOrderPrice +=
                    sec[j].purchasenum * parseFloat(sec[j].commodityprice);
                }
                if (mylist[i].orderrealprice != null) {
                  mylist[i].orderrealprice =
                    (num || "1") + "/" + mylist[i].orderrealprice;
                  console.log(mylist[i].orderrealprice);
                } else {
                  mylist[i].orderrealprice =
                    (num || "1") + "/" + totalOrderPrice;
                  console.log(mylist[i].orderrealprice);
                }
              }
              if (mylist[i].paymenttype != null) {
                mylist[i].paymenttype = mylist[i].paymenttype.toString();
                if (mylist[i].paymenttype == "1") {
                  mylist[i].paymenttype = "微信";
                } else if (mylist[i].paymenttype == "2") {
                  mylist[i].paymenttype = "支付宝";
                } else if (mylist[i].paymenttype == "3") {
                  mylist[i].paymenttype = "银联";
                } else {
                  mylist[i].paymenttype = "积分购买";
                }
              }
              if (mylist[i].orderstatus != null) {
                mylist[i].orderstatus = mylist[i].orderstatus.toString();
                if (mylist[i].orderstatus == "0") {
                  mylist[i].orderstatus = "待付款";
                } else if (mylist[i].orderstatus == "1") {
                  mylist[i].orderstatus = "待发货";
                } else if (mylist[i].orderstatus == "2") {
                  mylist[i].orderstatus = "待收货";
                } else if (mylist[i].orderstatus == "3") {
                  mylist[i].orderstatus = "已完成";
                } else if (mylist[i].orderstatus == "4") {
                  mylist[i].orderstatus = "已关闭";
                } else if (mylist[i].orderstatus == "5") {
                  mylist[i].orderstatus = "已取消";
                } else {
                  mylist[i].orderstatus = "";
                }
              }
            }
            this.list = mylist;
          }

          this.totalNumber = response.data.totalNumber || 0;
          /**
                        setTimeout(() => {
                        this.loading = false;
                    }, 1 * 1000);
                    */
        })
        .catch(() => {
          this.loading = false;
          this.list = [];
        });
    },
    tableRowClassName() {
      return "success-row";
    },
    /*日期选择事件*/
    dateChange(val) {
      if (val == null) {
        this.query.starttime = "";
        this.query.endtime = "";
      } else {
        this.query.starttime = val[0];
        this.query.endtime = val[1];
        this.query.currentPage = 1;
      }
      if (this.query.userAddress != "") {
        this.$refs["ruleForm"].validate((valid) => {
          if (valid) {
            this.getList();
          }
        });
      } else {
        if (
          this.query.provinceId != "" ||
          this.query.cityId != "" ||
          this.query.areaId != ""
        ) {
          this.$message.error("区域查询，收货地址不能为空");
        }
        this.query.provinceId = "";
        this.query.cityId = "";
        this.query.areaId = "";
        this.getList();
      }
    },
    /*列表查询条件事件*/
    onSubmit() {
      if (this.query.userAddress != "") {
        this.$refs["ruleForm"].validate((valid) => {
          if (valid) {
            this.query.currentPage = 1;
            this.getList();
          }
        });
      } else {
        if (
          this.query.provinceId != "" ||
          this.query.cityId != "" ||
          this.query.areaId != ""
        ) {
          this.$message.error("区域查询，收货地址不能为空");
        }
        this.query.provinceId = "";
        this.query.cityId = "";
        this.query.areaId = "";
        this.query.currentPage = 1;
        // this.$router.push({
        //     path: "",
        //     query: this.query
        // });
        this.getList();
      }
    },

    onRest() {
      this.createTime = [];
      (this.query = {
        //查询条件
        content: "",
        userid: "", //用户id
        onshelfstatus: "",
        currentPage: 1,
        pageSize: 5,
        starttime: "",
        endtime: "",
        commodityName: "",
        provinceId: "",
        cityId: "",
        areaId: "",
        userAddress: "",
      }),
        (this.today = true),
        (this.yestoday = true),
        (this.week = true),
        (this.month = true),
        this.getList();
    },
    //下拉框状态
    shelfstatus() {
      if (this.query.userAddress != "") {
        this.$refs["ruleForm"].validate((valid) => {
          if (valid) {
            this.query.currentPage = 1;

            this.getList();
          }
        });
      } else {
        if (
          this.query.provinceId != "" ||
          this.query.cityId != "" ||
          this.query.areaId != ""
        ) {
          this.$message.error("区域查询，收货地址不能为空");
        }
        this.query.provinceId = "";
        this.query.cityId = "";
        this.query.areaId = "";
        this.query.currentPage = 1;
        // this.$router.push({
        //     path: "",
        //     query: this.query
        // });
        this.getList();
      }
    },
    /*点击页数*/
    handleCurrentChange(val) {
      this.query.currentPage = val;
      this.getList();
    },

    /*选择每页条数【10,20,30,40,50】*/
    handleSizeChange(val) {
      this.query.pageSize = val;
      this.getList();
    },
    // 显示收货表单
    handleForm() {
      this.formVisible = true;
      this.formName = "add";
      this.shouhuo = Object.assign({}, this.shouhuodata);
      //this.getBusWarehouse();获取收货
    },
    hideForm() {
      // 更改值
      this.formVisible = !this.formVisible;
      return true;
    },
  },
  mounted() {
    this.query.userid = this.$route.query.userid;
  },
  created() {
    this.getList();
    this.getProvinceList();
  },
};
</script>

<style>
.el-table .warning-row {
  background: oldlace;
}
.el-table .success-row {
  background: #f0f9eb;
}
</style>
